
import sleep from 'sleep-promise'

export const foo = async () => {
  console.log('等待1秒钟会输出数字5')
  await sleep(1000)
  console.log(5)
}

export const foo2 = async () => {
  console.log('等待1秒钟会输出数字6')
  await sleep(1000)
  console.log(6)
}

export const foo3 = async () => {
  for (let index = 0; index < 5; index++) {
    // eslint-disable-next-line no-await-in-loop
    await sleep(200)
  }
}
